
package supply;

import java.io.*;

class product {
    String[] productName=new String[5];
    //ArrayList[] productName;
    int productQuantity;
    int[] productId=new int[5];
    int productSelected;
    inventory inv=new inventory();

    InputStreamReader is=new InputStreamReader(System.in);
    BufferedReader br=new BufferedReader(is);

     
    public void addProduct() throws IOException
   {
       for(int i=0;i<5;i++)
       {
       System.out.print("Enter the Product "+i+" : ");
       productName[i]=br.readLine();
       productId[i]=i;
       }
       for(int i=0;i<5;i++)
       {
           System.out.println();
           System.out.println("The Products No "+productId[i]+" is : "+productName[i]);
       }
       System.out.println("<----The Products are successfully added --->");
       
   }

   public void selectProduct() throws IOException
   {
       System.out.println();
       System.out.print("Enter the Product you want : ");
       productSelected=Integer.parseInt(br.readLine());
       System.out.print("Enter the Quantity you want : ");
       productQuantity=Integer.parseInt(br.readLine());

       System.out.println("The Product selected is : "+productSelected);
       System.out.println("The Product Quantity is : "+productQuantity);

if(productName != null)
{
       if(productSelected == 0)
       {
           inv.product0(productQuantity);
       }

       else if(productSelected == 1)
       {
           inv.product1(productQuantity);
       }

       else if(productSelected == 2)
       {
           inv.product2(productQuantity);
       }

       else if(productSelected == 3)
       {
           inv.product3(productQuantity);
       }

       else if(productSelected == 4)
       {
           inv.product4(productQuantity);
       }


        else if(productSelected == 5)
       {
           inv.product5(productQuantity);

        }
       
       else
       {
           System.out.println("Please Enter the Correct product....");
       }
}
else

    System.out.println("Please Enter the Product first ....");

}
}
